{% if request.cookies.get('Scr1wCTFdLanguage') == 'en' %}
{% set en = true %}
{% else %}
{% set en = false %}
{% endif %}
{% with form = Forms.users.UserEditForm(obj=user) %}
{% from "admin/macros/forms.html" import render_extra_fields %}
<form id="user-info-edit-form">
	<div class="form-group">
        {% if en %}
        <label for="name">Username</label>
        {% else %}
        {{ form.name.label }}
        {% endif %}
		{{ form.name(class="form-control", autocomplete="off") }}
	</div>
	<div class="form-group">
        {% if en %}
        <label for="email">Email</label>
        {% else %}
        {{ form.email.label }}
        {% endif %}
		{{ form.email(class="form-control", autocomplete="off") }}
	</div>
	<div class="form-group">
        {% if en %}
        <label for="sname">Real Name</label>
        {% else %}
        {{ form.sname.label }}
        {% endif %}
		{{ form.sname(class="form-control", autocomplete="off") }}
	</div>
	<div class="form-group">
        {% if en %}
        <label for="sid">Student Number</label>
        {% else %}
        {{ form.sid.label }}
        {% endif %}
		{{ form.sid(class="form-control", autocomplete="off") }}
	</div>
	<div class="form-group">
        {% if en %}
        <label for="password">Password</label>
        {% else %}
        {{ form.password.label }}
        {% endif %}
		{{ form.password(class="form-control", autocomplete="off") }}
	</div>
	<div class="form-group">
        {% if en %}
        <label for="website">Website</label>
        {% else %}
        {{ form.website.label }}
        {% endif %}
		{{ form.website(class="form-control", autocomplete="off") }}
	</div>
	<div class="form-group">
        {% if en %}
        <label for="affiliation">Affiliation/Signature</label>
        {% else %}
        <label for="affiliation">所属单位/个性签名</label>
        {% endif %}
		{{ form.affiliation(class="form-control", autocomplete="off") }}
	</div>
	<div class="form-group">
        {% if en %}
        <label for="country">Country or region</label>
        {% else %}
        {{ form.country.label }}
        {% endif %}
		{{ form.country(class="form-control custom-select", autocomplete="off") }}
	</div>

	{{ render_extra_fields(form.extra) }}

	<div class="form-group">
		<div class="form-check form-check-inline">
			{{ form.type(class="form-control form-inline custom-select", id="type-select") }}
		</div>
		<div class="form-check form-check-inline">
			{{ form.verified(class="form-check-input", autocomplete="off") }}
            {% if en %}
            <label class="form-check-label" for="verified">Verified</label>
            {% else %}
            {{ form.verified.label(class="form-check-label") }}
            {% endif %}
		</div>
		<div class="form-check form-check-inline">
			{{ form.hidden(class="form-check-input", autocomplete="off") }}
            {% if en %}
            <label class="form-check-label" for="hidden">Hidden</label>
            {% else %}
            {{ form.hidden.label(class="form-check-label") }}
            {% endif %}
		</div>
		<div class="form-check form-check-inline">
			{{ form.banned(class="form-check-input", autocomplete="off") }}
            {% if en %}
            <label class="form-check-label" for="banned">Banned</label>
            {% else %}
            {{ form.banned.label(class="form-check-label") }}
            {% endif %}
		</div>
	</div>
	<div id="results">
	</div>

    {% if en %}
    {{ form.submit(class="btn btn-primary btn-outlined float-right modal-action",value="Update") }}
    {% else %}
    {{ form.submit(class="btn btn-primary btn-outlined float-right modal-action") }}
    {% endif %}
</form>
{% endwith %}
